/*    */ package com.qmsk.business.member.memberCouponRule.dao;
/*    */ 
/*    */ import com.qmsk.business.sys.basic.SupportDAO;
/*    */ import com.utils.gson.in.GsonHeadManyRows;
/*    */ import com.utils.gson.in.GsonHeadOneRow;
/*    */ import com.utils.gson.out.GsonEbRst;
/*    */ import java.sql.SQLException;
/*    */ import java.util.HashMap;
/*    */ import java.util.Map;
/*    */ import org.apache.commons.lang.StringUtils;
/*    */ 
/*    */ public class MemberCouponRuleDao extends SupportDAO
/*    */ {
/*    */   public GsonEbRst getGsonOfId(Long id)
/*    */     throws SQLException
/*    */   {
/* 17 */     Map params = new HashMap();
/* 18 */     params.put("id", id);
/* 19 */     return getGsonOfParams("selectSqlOfAll", params, false);
/*    */   }
/*    */ 
/*    */   public GsonHeadOneRow getOneRowOfId(Long id) throws SQLException {
/* 23 */     Map params = new HashMap();
/* 24 */     params.put("id", id);
/* 25 */     return getOneRowOfParams("selectSqlOfAll", params);
/*    */   }
/*    */ 
/*    */   public Integer updateStatusOfId(Long id) throws SQLException {
/* 29 */     Map params = new HashMap();
/* 30 */     params.put("id", id);
/* 31 */     return Integer.valueOf(update("updateStatusOfId", params));
/*    */   }
/*    */ 
/*    */   public GsonEbRst getGsonOfAll(Map<String, Object> params, Integer nPageIdx, Short nPageSize)
/*    */     throws SQLException
/*    */   {
/* 41 */     return getGsonOfParams("selectSqlOfAll", params, nPageIdx, nPageSize, true);
/*    */   }
/*    */ 
/*    */   public boolean call_Create_ConponMaxNo(Object[] in, Object[] out) throws SQLException {
/* 45 */     return callSP2("sp_GetTableConponMaxNo", in, out);
/*    */   }
/*    */ 
/*    */   public String getConponMaxNo(String couponNo) throws SQLException {
/* 49 */     String coupon = null;
/* 50 */     if (StringUtils.isNotEmpty(couponNo))
/*    */     {
/* 56 */       Object[] in = { "crm_membercouponrule", "RuleFlag", couponNo };
/* 57 */       Object[] out = { "" };
/* 58 */       if (callSP2("sp_GetTableConponMaxNo", in, out)) {
/* 59 */         coupon = (String)out[0];
/*    */       }
/*    */     }
/* 62 */     return coupon;
/*    */   }
/*    */ 
/*    */   public String getRuleFlag(Long shopId) throws SQLException {
/* 66 */     Object[] params = { shopId };
/* 67 */     return queryForString("getRuleFlag", params, null);
/*    */   }
/*    */ 
/*    */   public GsonHeadOneRow getCouponRuleOneRowInfo(Long shopId) throws SQLException {
/* 71 */     Map params = new HashMap();
/* 72 */     params.put("shopId", shopId);
/* 73 */     return getOneRowOfParams("selectSqlCouponList", params);
/*    */   }
/*    */ 
/*    */   public GsonHeadOneRow getCouponRuleOneRowById(Long id) throws SQLException
/*    */   {
/* 78 */     Map params = new HashMap();
/* 79 */     params.put("id", id);
/* 80 */     return getOneRowOfParams("selectSqlCouponList", params); }
/*    */ 
/*    */   public GsonEbRst getCouponRuleList(Map<String, Object> params, Integer nPageIdx, Short nPageSize) throws SQLException {
/* 83 */     return getGsonOfParams("selectSqlOfAll", params, nPageIdx, nPageSize, true); }
/*    */ 
/*    */   public GsonHeadManyRows getCouponRuleList() throws SQLException {
/* 86 */     Object[] params = new Object[0];
/* 87 */     return getManyRowsOfParams("selectSqlOfAll", params); }
/*    */ 
/*    */   public int updateUsed(Long id) throws SQLException {
/* 90 */     Map params = new HashMap();
/* 91 */     params.put("id", id);
/* 92 */     return update("updateUsed", params);
/*    */   }
/*    */ }

/* Location:           C:\Users\Administrator\Desktop\新建文件夹\WEB-INF\classes\
 * Qualified Name:     com.qmsk.business.member.memberCouponRule.dao.MemberCouponRuleDao
 * JD-Core Version:    0.5.3
 */